//
//  JSFriendVC.m
//  NiubilityProject
//
//  Created by Apple on 2017/12/4.
//  Copyright © 2017年 Apple. All rights reserved.
//

#import "JSFriendVC.h"
#import "JSHeaebyNaviView.h"
@interface JSFriendVC ()
@property (nonatomic, weak) JSHeaebyNaviView *naviView;
@property (nonatomic, assign) BOOL isAttention;
@end

@implementation JSFriendVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
- (void)setNavigationItemsIsInEditMode:(BOOL)isInEditMode animated:(BOOL)animated{
    [super setNavigationItemsIsInEditMode:isInEditMode animated:animated];
    JSHeaebyNaviView *naviView = [[JSHeaebyNaviView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH * 0.5, 40) titles:@[JSLocalizedString(@"attentionLoca"),JSLocalizedString(@"fansLoca")]];
    self.naviView = naviView;
    self.navigationItem.titleView = naviView;
    JS_WeakSelf(self)
    [RACObserve(self.naviView, isNearby)subscribeNext:^(id x) {
        weakself.isAttention = [x boolValue];
        dispatch_async(dispatch_get_main_queue(), ^{
            [MBManager showLoading];
        });
        [weakself headerRefresh];
    }];
}
- (void)loadData:(BOOL)isNewData{
    if (self.isAttention) {
        self.mouth = @"starList";
        self.params = @{}.mutableCopy;
    }else{
        self.mouth = @"";
        self.params = @{}.mutableCopy;
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
